package com.li.jobs;

import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.JedisPool;

import java.util.Set;

public class CleanRedis4mobile {
    @Autowired
    private JedisPool jedisPool;
    public  void clearRedis(){
        Set<String> keys = jedisPool.getResource().keys("setmealBy*");
        for (String key : keys) {
            jedisPool.getResource().del(key);
            System.out.println("删除缓存"+key+"成功");
        }
    }
}
